package com.jingming.consult.adapters

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.jingming.consult.fragment.MyFragment
import com.jingming.consult.fragment.OneFragment
import com.jingming.consult.fragment.ThreeFragment
import com.jingming.consult.fragment.TwoFragment

class MainFragmentAdapter(fm: FragmentManager) :
    FragmentPagerAdapter(fm) {
    var fragmentList: MutableList<Fragment> = ArrayList()

    init {
        fragmentList.add(OneFragment())
        fragmentList.add(TwoFragment())
        fragmentList.add(ThreeFragment())
        fragmentList.add(MyFragment())
    }

    override fun getItem(position: Int): Fragment {
        return fragmentList.get(position)
    }

    override fun getCount(): Int {
        return fragmentList.size
    }
}